$(function () {


    $(".search-button").click(function () {
        searchData();
    })


    getFormToJson = function () {
        var searchCondition = $("#queryForm").serialize();
        var obj = {};
        var pairs = searchCondition.split('&');
        var name, value;
        $.each(pairs, function (i, pair) {
            pair = pair.split('=');
            name = decodeURIComponent(pair[0]);
            value = decodeURIComponent(pair[1]);
            if (value != '') {
                obj[name] = !obj[name] ? value : obj[name] + "," + (value); //若有多个同名称的参数，则拼接成逗号分隔
            }
        });
        return obj;
    }

    getCheckedIds = function (gridId) {
        var cs = $('#' + gridId).datagrid('getChecked');
        var ids = "";
        if (null == cs) {
            return ids;
        }
        for (var i = 0; i < cs.length; i++) {
            ids += cs[i].id + ",";
        }
        return ids;

    }

});
